package com.yt.sys.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.sys.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.sys.mapper.SysRoleMapper;
import com.yt.sys.models.service.ISysRoleService;
import com.yt.sys.models.bo.SysRoleSaveBO;
import com.yt.sys.models.dto.SysRoleDTO;

/**
 * 角色信息控制器
 *
 * @author yzz
 * @Date 2025-09-03 14:09:38
 */
@DubboService
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRoleDTO> implements ISysRoleService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(SysRoleSaveBO saveBO) {
        SysRoleDTO dto = new SysRoleDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
